﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Functions
{
    public class myFunctions
    {
        public static int CountSundays (DateTime startDate, DateTime endDate)    
        {        
            int sundayCount = 0;        
            for (DateTime dt = startDate; dt <= endDate; dt = dt.AddDays(1.0))        
            {            
                if (dt.DayOfWeek == DayOfWeek.Sunday)            
                    {                
                        sundayCount++;            
                    }        
            }        
            return sundayCount;    
        }   
        public static string DayString (int myDayInt)
        {
            switch (myDayInt)
            {
                case 1:
                    return "Monday";
                case 2:
                    return "Tuesday";
                case 3:
                    return "Wednesday";
                case 4:
                    return "Thursday";
                case 5:
                    return "Friday";
                case 6:
                    return "Saturday";
                default:
                    return "Error";
            }
        }
    }
}
